/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.merak.core.web.mvc;

@SuppressWarnings("serial")
public class ExceptionView extends Exception {

	//~ Attributes ///////////////////////////////////////////////////////////////
	//****************************************************************************
	private int    httpError = 400;
	private String view      = null;

	//~ Constructors /////////////////////////////////////////////////////////////
	//****************************************************************************
    public ExceptionView(String msg,String view) {

    	// Initialize attributes
        super(msg);

		// Check parameters. Msg can be null.
		if (view==null) {
			throw new IllegalArgumentException("Parameter 'view' is null");
		}
        this.view = view;

    }
	//****************************************************************************
    public ExceptionView(String msg,String view,int httpError) {

    	// Initialize attributes
        super(msg);
        this.view      = view;
        this.httpError = httpError;

		// Check parameters. Msg can be null.
		if (view==null) {
			throw new IllegalArgumentException("Parameter 'view' is null");
		}

    }
	//~ Methods //////////////////////////////////////////////////////////////////
	//****************************************************************************
	public int getHttpError() {
		return this.httpError;
	}
	//****************************************************************************
	public String getView() {
		return this.view;
	}
	//****************************************************************************

}
